package cn.momo.mobile.nearby.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

/**
 *
 */
public class LauchAdapter extends BaseAdapter{
	private Context mContext;
	private int[] mList;
	
	public LauchAdapter(Context context,int[] list){
		mContext = context;
		
//		if(list != null){
//			mList = list;
//		}else{
//			mList = new ArrayList<Integer>();
//		}
		
		if(list.length != 0){
			mList = list;
		}else{
			mList = new int[10];
		}
	}
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mList.length;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mList[position];
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ImageView imageView = new ImageView(mContext);
		imageView.setImageResource(mList[position]);
		return imageView;
	}

}
